package com.xueke.crawler.helper;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

/**
 * Created by weibo on 2017/5/13.
 *
 * @author weibo.qin
 * @version 2017/5/13
 */
public class HttpHelper {

    public static Document getSimpleDocument(String url) {

        try {
            return Jsoup.connect(url).ignoreContentType(true).userAgent("Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 " +
                "(KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36")
                .timeout(30000).get();
        } catch (Exception e) {
            return null;
        }

    }
}
